﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Net.Sockets;

namespace VxiServer
{
    class PolCode0x26 : PolCode
    {
        public override byte Code
        {
            get { return 0x26; }
        }

        public override void Work(TcpClient client, string ipAddress, byte[] buffer)
        {
            byte[] packet1 =  {
			0x28, 0x00, 0x00, 0x00, 0x49, 0x58, 0x46, 0x46, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
			0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4f, 0xe0, 0x5d, 0xad, 
			0x3F, // Bit mask for expansions
            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };

            MD5 md5Hasher = MD5.Create();
            byte[] data = md5Hasher.ComputeHash(packet1);

            Buffer.BlockCopy(data, 0, packet1, 12, data.Length);

            client.Client.Send(packet1);
        }
    }
}
